<template>
  <el-dialog
    title="配置变量"
    :visible.sync="form.variableFormVisible"
    @close="closeDialog"
  >
    <el-form :model="updateForm">
      <el-form-item label="变量编号" :label-width="formLabelWidth">
        <el-input v-model="updateForm.vId" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="变量说明" :label-width="formLabelWidth">
        <el-input v-model="updateForm.vInfo" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="变量名" :label-width="formLabelWidth">
        <el-input v-model="updateForm.vName" autocomplete="off"></el-input>
      </el-form-item>
      <el-form-item label="变量值" :label-width="formLabelWidth">
        <el-input type="textarea" v-model="updateForm.vValue"></el-input>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="closeDialog">取 消</el-button>
      <el-button type="primary" @click="variableUpdate(updateForm)"
        >确 定</el-button
      >
    </div>
  </el-dialog>
</template>

<script>
import { mapState, mapMutations, mapActions } from "vuex";

export default {
  name: "DialogShow",
  data() {
    return {
      formLabelWidth: "120px",
    };
  },
  computed: {
    ...mapState("variable", ["form", "updateForm"]),
  },
  methods: {
    ...mapMutations("variable", ["closeDialog"]),
    ...mapActions('variable',['variableUpdate'])
  },
};
</script>

<style scoped>
</style>